Better ci tests logging for windows#4193
Open
rasapala wants to merge 4 commits into
Open
Conversation
przepeck
approved these changes
May 8, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to make Windows CI test execution more diagnosable and reliable by improving logging/artifact generation and adding crash/failure context extraction for Jenkins.
Changes:
- Adjust Windows pytest invocation to preserve the true pytest exit code while still emitting output to the console/log artifact.
- Enhance Windows test log summarization and add failure/crash diagnostics (last OK/RUN test and trailing log context).
- Update Jenkins Windows pipeline checks/diagnostics and ensure
pytestis installed on Windows agents.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
windows_test.bat |
Updates pytest logging/exit-code handling; adds summary creation and failure/crash diagnostics for gtest runs. |
windows_install_build_dependencies.bat |
Adds pytest to the Python dependencies installed on Windows nodes. |
src/test/ovmsconfig_test.cpp |
Modifies an existing unit test assertion in OvmsConfigDeathTest.bufferTest. |
ci/loadWin.groovy |
Adds segfault/crash-focused diagnostics when the PASSED marker is not found in the Windows test log. |
Comment on lines
+124
to
+132
| :: Check if tests completed successfully by looking for PASSED marker at the end | ||
| grep -q " PASSED " win_full_test.log | ||
| if !errorlevel! equ 0 goto :exit_build | ||
|
|
||
| :: Tests did not complete successfully - check for failures and segfaults | ||
| :: Check if tests failed by looking for FAILED in the full log | ||
| grep -q " FAILED " win_full_test.log | ||
| if !errorlevel! equ 0 goto :exit_build_error | ||
|
|
Comment on lines
+120
to
+122
| grep -a %regex% win_full_test.log | sed %sed_clean% > win_test_summary.log 2>&1 || ( | ||
| echo No matching test results found >> win_test_summary.log | ||
| ) |
| std::cout << input; | ||
| std::string check{buffer.str()}; | ||
| EXPECT_EQ(input, check); | ||
| EXPECT_EQ(input, "ddddd"); |
| if !errorlevel! neq 0 exit /b !errorlevel! | ||
| :: setuptools<60.0 required for numpy1.23 on python311 to install | ||
| %python_path%\python.exe -m pip install "numpy==2.2.5" "Jinja2==3.1.6" "MarkupSafe==3.0.2" | ||
| %python_path%\python.exe -m pip install "numpy==2.2.5" "Jinja2==3.1.6" "MarkupSafe==3.0.2" "pytest" |
Comment on lines
290
to
+292
| status = bat(returnStatus: true, script: 'grep " PASSED " win_full_test.log') | ||
| if (status != 0) { | ||
| // Check for segfault/termination only if PASSED is not found |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🛠 Summary
Fixes critical issues in Windows test execution that prevented proper artifact collection and failure reporting:
Changes:
Fix missing win_test_summary.log — Added error handling to ensure summary log is always created, even when grep finds no matches. Previously, grep failure in the pipeline caused the file to not be generated.
Capture pytest exit code correctly — Removed pipe to tee that was masking pytest exit status, preventing pytest import errors from being caught. Now captures exit code before continuing.
Detect testcompletes successfully — Check for "PASSED" marker in full test log. Only perform crash/failure diagnostics if PASSED marker is absent, avoiding unnecessary processing on successful runs.
Improve failure visibility — Display:
Last successful test
Last running test (identifies the failing test regardless of log size)
Output from last running test to end of log (100 lines)
Segfault/crash messages
Apply improvements to CI pipeline — Updated loadWin.groovy with same PASSED marker check before reporting segfault diagnostics.
Add missing pytest.
Impact:
Jenkins now reliably captures test artifacts even on failure
Test failures and segfaults are immediately visible in console output
Easier root cause analysis without needing to inspect full log files
🧪 Checklist
``